/*
 * Copyright (C) 2014 ilknur
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package terp.core.menu;

import java.util.List;
import javax.swing.JMenu;
import terp.plugin.IMenuManager;

/**
 *
 * @author ilknur
 */
public class MenuManager implements IMenuManager{
    
    //local variables
    private List<JMenu> menus;
    
    /**
     * return menu at given index
     * @param index
     * @return
     */
    @Override
    public JMenu getMenu(int index){
        return menus.get(index);
    }
    
    /**
     * add a menu at and of list
     * @param menu
     */
    @Override
    public void addMenu(JMenu menu){
        menus.add(menu);
    }
    
    /**
     * count of menus
     * @return
     */
    @Override
    public int getCount(){
        return menus.size();
    }
}
